package com.iwayin.core.dao.answer;

import java.util.List;

import com.iwayin.core.dataobject.AnswerDO;

public interface AnswerDAO {
	/**
	 * @description 添加answer
	 * @author ZhangLei
	 * @param answer
	 * @return
	 */
	public Long addAnswer(AnswerDO answer);

	/**
	 * @description 判读是否允许再次添加answer
	 * @author ZhangLei
	 * @param answer
	 * @return
	 */
	public List<AnswerDO> findAnswerByAskUserId(AnswerDO answer);

	/**
	 * @description 删除answer
	 * @author ZhangLei
	 * @param answer
	 */
	public void deleteAnswer(AnswerDO answer);

	/**
	 * 根据askId删除answer，情形：删除ask级联删除
	 * 
	 * @param askId
	 * @return
	 */
	public Integer deleteAnswerByAskId(Long askId);

	/**
	 * @description 查询answer
	 * @author ZhangLei
	 * @param query
	 * @return
	 */
	public List<AnswerDO> findAnswers(AnswerDO query);
	/**
	 * 根据回答内容查询
	 * @param query
	 * @return
	 */
	public AnswerDO findAnswerByBody(AnswerDO query);
	/**
	 * 投票数+1
	 * 
	 * @param answerId
	 */
	public void answerVoteCountPlusOne(Long answerId);

	/**
	 * 投票数-1
	 * 
	 * @param answerId
	 */
	public void answerVoteCountDownOne(Long answerId);
	
	public AnswerDO findAnswerById(Long answerId);

}
